// function createArray<T>(len: number, value: T) {
//     const result = []
//     for (let i = 0; i < len; i++) {
//         result.push(value)
//     }
//     return result
// }

const createArray = <T>(len: number, value: T) => {
    const result = []
    for (let i = 0; i < len; i++) {
        result.push(value)
    }
    return result
}

console.log(createArray<string>(3, '幸福美满'))
console.log(createArray<number>(5, 888))
console.log(createArray<boolean>(5, true))

export { }
